package com.hainingtong.user.service;

import com.hainingtong.user.entity.*;
import com.hainingtong.user.util.page.PageResult;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface UserService {
    SysUser findUserById(int userId);
    SysUser register(String nickname, String principal, String credential, String loginType);
    SysAuth findAuthByPrincipalAndType(String principal, String type);
    SysUser findUserByPrincipalAndType(String principal, String type);

    boolean isUserExists(String principal, String type);

    PageResult getUsers(int page, int size);

    List<SysPermission> findAllPermissions();
    List<SysRole> findAllRoles();
    UserWithRolesAndPermissions findUserWithRolesAndPermissions(int userId);
}
